classdef dotsTestCase < TestCase
    
    methods
        function self = dotsTestCase(name)
            self = self@TestCase(name);
        end
        
        function setUp(self)
            self.grandReset;
            dotsTestCase.callFunction('setUpFunction');
        end
        
        function tearDown(self)
            self.grandReset;
            dotsTestCase.callFunction('tearDownFunction');
        end
        
        function grandReset(self)
            dotsTheMachineConfiguration.reset;
            dotsTheSwitchboard.reset;
            dotsTheMessenger.reset;
            dotsTestCase.callFunction('resetFunction');
        end
    end
    
    methods (Static)
        function callFunction(functionName)
            global DOTS_TEST_DATA
            if ~isempty(DOTS_TEST_DATA)
                if isfield(DOTS_TEST_DATA, functionName)
                    feval(DOTS_TEST_DATA.(functionName));
                end
            end
        end
        
        function waitForLookSee
            global DOTS_TEST_DATA
            if ~isempty(DOTS_TEST_DATA)
                if isfield(DOTS_TEST_DATA, 'lookSee')
                    WaitSecs(DOTS_TEST_DATA.lookSee);
                end
            end
        end
    end
end